<?php

declare(strict_types=1);

/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

use Hyperf\HttpServer\Router\Router;

Router::get('/favicon.ico', function () {
    return '';
});

################################################ test-router ################################################
Router::addGroup('/test', function () {
    Router::post('/test/refresh.php', [App\Controller\IndexController::class, 'refreshLogin']);
    Router::post('/test/encode.php', [App\Controller\IndexController::class, 'encode']);
    Router::post('/test/decode.php', [App\Controller\IndexController::class, 'decode']);
    Router::post('/test/sdecode.php', [App\Controller\IndexController::class, 'sdecode']);// 后端解密前端加密
    Router::post('/logger', [App\Controller\IndexController::class, 'logger']);

    Router::addRoute(['GET', 'POST', 'HEAD'], '/memcache', [App\Controller\Test\CacheDemoController::class, 'memcache']);
    Router::addRoute(['GET', 'POST', 'HEAD'], '/redis', [App\Controller\Test\CacheDemoController::class, 'redis']);
    Router::addRoute(['GET', 'POST', 'HEAD'], '/valid', [App\Controller\Test\ValidatedController::class, 'index']);
});


################################################ router ################################################
Router::addGroup('/app/v1', function () {
    Router::addRoute(['GET', 'POST'], '/notify/notify_callback.php', [App\Controller\Notify\YunXin\CallbackController::class, 'callback']);// 云信消息第三方回调
    Router::addRoute(['GET', 'POST'], '/notify/notify_copy.php', [App\Controller\Notify\YunXin\CallbackController::class, 'copy']); // 云信消息抄送
    Router::addRoute(['GET', 'POST'], '/build_point.php', [App\Controller\Setting\BuildPointController::class, 'index']); // 埋点事件记录
});

Router::addGroup('/app/v1', function () {
    Router::addRoute(['GET', 'POST'], '/test/test.php', [App\Controller\IndexController::class, 'index']);

    Router::post('/send/captcha', [App\Controller\Access\SendController::class, 'captcha']); // 发送验证码

    Router::post('/init/check_version.php', [App\Controller\Init\CheckController::class, 'checkVersion']);// 客户端检查最新版本
    Router::post('/aliyun/init.php', [App\Controller\Init\AliYunController::class, 'resource']);// 获取阿里云oss上传的参数
    Router::get('/aliyun/upload_tokens.php', [App\Controller\Init\AliYunController::class, 'uploadTokens']);// 获取阿里云oss临时凭证


    Router::post('/index/heartbeat.php', [App\Controller\Index\HeartBeatController::class, 'clickHeartBeat']);// 心跳判断, 记录用户最新点击时间
    Router::post('/index/user_list.php', [App\Controller\Index\UserController::class, 'list']);// 客户端首页用户列表接口
    Router::post('/index/fate_layer.php', [App\Controller\Index\FateController::class, 'layer']);// 缘分推荐弹出框
    Router::post('/index/user_search.php', [App\Controller\Index\UserController::class, 'userSearch']);// 首页搜索接口
    Router::post('/index/gift_show.php', [App\Controller\Index\UserController::class, 'giftShow']);// 首页礼物飘窗数据接口
    Router::post('/index/common_words.php', [App\Controller\Index\UserController::class, 'getChatCommonWords']);// 聊天常用语
    Router::post('/index/head_img_show.php', [App\Controller\Index\UserController::class, 'getSpeedHead']);// 获取匹配头像（10秒/次，连续30秒没有就返回）

    Router::post('/push/action_notify.php', [App\Controller\Index\FrontBackController::class, 'switchFrontBack']);// APP前后台切换


    Router::post('/topic/topic_list.php', [App\Controller\Topic\TopicController::class, 'list']);// 推荐、或者关注用户的帖子列表
    Router::post('/topic/insert_topic.php', [App\Controller\Topic\TopicController::class, 'create']);// 推荐、或者关注用户的帖子列表
    Router::post('/topic/topic_info.php', [App\Controller\Topic\TopicController::class, 'detail']);// 帖子详情
    Router::post('/topic/del_my_topic.php', [App\Controller\Topic\TopicController::class, 'delete']);// 删除帖子
    Router::post('/topic/insert_reply.php', [App\Controller\Topic\TopicReplyController::class, 'reply']);// 回复贴
    Router::post('/topic/topic_dian_zan.php', [App\Controller\Topic\TopicReplyController::class, 'zan']);// 点赞
    Router::post('/topic/delete.php', [App\Controller\Topic\TopicReplyController::class, 'delete']);// 回帖删除

    Router::post('/call/call.php', [App\Controller\Call\CallController::class, 'call']);// 发起视频语音呼叫
    Router::post('/call/free.php', [App\Controller\Call\CallController::class, 'getMatchingUsers']);// 获取匹配的用户
    Router::post('/call/call_list.php', [App\Controller\Call\CallController::class, 'getCallList']);// 消息-通话列表
    Router::post('/call/call_show.php', [App\Controller\Call\CallController::class, 'callCover']);// 获取、设置通话封面
    Router::post('/call/refuse.php', [App\Controller\Call\CallController::class, 'refuse']);// 接听方拒绝接听，通知服务器通知发起方
    Router::post('/call/answer.php', [App\Controller\Call\CallController::class, 'answer']);// 接听方接听，通知服务器
    Router::post('/call/hang_up.php', [App\Controller\Call\CallController::class, 'hangUp']);// 通话挂断
    Router::post('/call/answer_alive.php', [App\Controller\Call\AliveController::class, 'answerAlive']);// 接听方请求answer后立即定时6秒请求
    Router::post('/call/launch_alive.php', [App\Controller\Call\AliveController::class, 'launchAlive']);// 发起方每6秒请求一次的接口（收到第一帧流就请求）
    Router::post('/call/call_income.php', [App\Controller\My\WalletController::class, 'callIncome']);// 个人中心-通话收支明细

    // 个人中心
    Router::post('/my/backpack.php', [App\Controller\My\MyController::class, 'backpack']);// 用户背包
    Router::post('/my/my_gift.php', [App\Controller\My\MyController::class, 'receiveOrGiveGift']);// 主播收到的和男用户送出的礼物（礼物墙）
    Router::post('/my/my_info.php', [App\Controller\My\MyController::class, 'myInfo']);// 个人中心-我的
    Router::post('/my/video_action.php', [App\Controller\My\MyController::class, 'videoAction']);// 个人中心-我的视频管理接口（增删改）

    /*接口名兼容my/photo_action.php=/user/photo.php*/
    Router::post('/my/photo_action.php', [App\Controller\My\MyController::class, 'photoAction']);// 个人中心-我的照片管理接口（增删改查）
    Router::post('/user/photo.php', [App\Controller\My\MyController::class, 'photoAction']);// 个人中心-我的照片管理接口（增删改查）
    /*接口名兼容my/photo_action.php=/user/photo.php*/

    Router::post('/my/msg_num.php', [App\Controller\My\MyController::class, 'unreadMessageNum']);// 个人中心-未读消息数量
    Router::post('/my/bind_user.php', [App\Controller\My\MyController::class, 'bindPhonePassword']);// 个人中心-用户绑定手机+修改密码
    Router::post('/my/head_image_edit.php', [App\Controller\My\MyController::class, 'headImageEdit']);// 个人中心-用户修改头像
    // Router::post('/my/video_upload.php', [App\Controller\My\MyController::class, 'uploadVideo']);// 个人中心-我的视频上传 /app/v1/mailbox/video_upload.php
    Router::post('/my/want_evaluate.php', [App\Controller\My\MyController::class, 'wantEvaluate']);// 设置用户喜欢的标签列表

    Router::post('/my/visitor_list.php', [App\Controller\My\VisitorController::class, 'list']);// 个人中心-我的访客和我的浏览

    Router::post('/my/cash_record.php', [App\Controller\My\WalletController::class, 'cashRecord']);// 个人中心-提现记录列表
    Router::post('/my/pay_record.php', [App\Controller\My\WalletController::class, 'payRecord']);// 个人中心-充值明细
    Router::post('/my/income_expense.php', [App\Controller\My\WalletController::class, 'incomeExpense']);// 个人中心-收支明细
    Router::post('/my/my_wallet.php', [App\Controller\My\WalletController::class, 'wallet']);// 个人中心-我的钱包

    Router::post('/my/invite_list.php', [App\Controller\My\InviteController::class, 'inviteList']);// 个人中心-分享赚钱


    Router::post('/user/login.php', [App\Controller\LoginController::class, 'login']);// 注册+登录
    Router::post('/user/session.php', [App\Controller\Access\SessionController::class, 'session']); // 客户端开启访问接口,APP初始化
    Router::post('/user/logout.php', [App\Controller\LoginController::class, 'loginOut']);// 退出登录
    Router::post('/user/user_detail.php', [App\Controller\User\UserController::class, 'detail']);// 用户详情页接口
    Router::post('/user/user_detail_other.php', [App\Controller\User\UserController::class, 'detailOther']);// 用户详情页接口,其他数据(照片墙，礼物墙)
    Router::post('/user/user_photos.php', [App\Controller\User\UserController::class, 'photos']);// 获取相册列表,及其是否被访问过
    Router::post('/user/user_video.php', [App\Controller\User\UserController::class, 'videos']);// 获取视频列表,及其是否被访问过
    Router::post('/user/about_friend.php', [App\Controller\User\UserController::class, 'aboutFriend']);// 征友条件列表获取和编辑征友条件
    Router::post('/user/anchor_greet.php', [App\Controller\User\UserController::class, 'anchorGreet']);// 主页停留，主播自动打招呼
    Router::post('/user/backpack.php', [App\Controller\User\UserController::class, 'backpack']);// 我的背包
    Router::post('/user/base_info.php', [App\Controller\User\UserController::class, 'baseInfo']);// 用户基本信息接口，聊天对话框
    Router::post('/user/closeness.php', [App\Controller\User\UserController::class, 'closeness']);// 获取用户关系亲密度数据接口
    Router::post('/user/edit_info.php', [App\Controller\User\UserController::class, 'editInfo']);// 修改个人资料
    Router::post('/user/perfect.php', [App\Controller\User\UserController::class, 'perfect']);// 完善个人资料+绑定公会+设置收费
    Router::post('/user/followlist.php', [App\Controller\User\UserController::class, 'followList']);// 我的关注列表
    Router::post('/user/follow.php', [App\Controller\User\UserController::class, 'follow']);// 关注与取消关注
    Router::post('/user/exchange_gift_count.php', [App\Controller\User\UserController::class, 'exchangeGiftCount']);// 查询、兑换金币
    Router::post('/user/sign_list.php', [App\Controller\User\UserController::class, 'signList']);// 签到列表
    Router::post('/user/sign.php', [App\Controller\User\UserController::class, 'sign']);// 签到
    Router::post('/user/user_black.php', [App\Controller\User\UserController::class, 'blackList']);// 黑名单列表
    Router::post('/user/user_black_set.php', [App\Controller\User\UserController::class, 'setBlacklist']);// 设置、解除黑名单用户
    Router::post('/user/anchor_tease.php', [App\Controller\User\ChatController::class, 'tease']);// 一键打招呼
    Router::post('/user/batch_greet_user.php', [App\Controller\User\ChatController::class, 'getBatchGreetUser']);// 批量获取打招呼用户(今日缘分，只有男用户有)
    Router::post('/user/my_greeting_list.php', [App\Controller\User\GreetMasterController::class, 'getGreetingList']);// 女用户获取打招呼列表(call/my_greeting_list.php)
    Router::post('/user/upload_greet_master.php', [App\Controller\User\GreetMasterController::class, 'edit']);// 创建、编辑打招呼模版本(/call/upload_greet_master.php)
    Router::post('/user/delete_greet_master.php', [App\Controller\User\GreetMasterController::class, 'delete']);// 删除打招呼模版本(call/delete_greet_master.php)
    Router::post('/user/setting_greet.php', [App\Controller\User\GreetMasterController::class, 'settingGreet']);// 设置快捷打招呼模板


    Router::post('/user/can_close_account.php', [App\Controller\User\AccountController::class, 'canCancelAccount']);// 用户是否能注销账号
    Router::post('/user/close_account.php', [App\Controller\User\AccountController::class, 'cancelAccount']);// 用户注销账号
    Router::post('/user/check_gold.php', [App\Controller\User\AccountController::class, 'judgeGold']);// 判断用户金币是否足够

    Router::post('/user/check_photo.php', [App\Controller\User\ResourceController::class, 'vipSeeVideoOrPhoto']);// vip用户查看用户私密图片/视频
    Router::post('/user/config_info.php', [App\Controller\User\ResourceController::class, 'userConfigInfo']);// 修改个人资料时, 返回用户基本信息配置：婚姻、体重、学历、收入、职业
    Router::post('/user/active_rules.php', [App\Controller\User\ResourceController::class, 'activeRule']);// 速配规则+亲密度升级提示+邀请奖励+客服电话


    Router::post('/user/send_gift.php', [App\Controller\Gift\GiftController::class, 'sendGift']);// 赠送礼物


    Router::post('/setting/get_wealth.php', [App\Controller\Setting\SettingController::class, 'getWealth']);// 获取用户等级,当前等级，下一级，当等级值和下一级值的差，当前等级值到下一等级值完成的百分比
    Router::post('/setting/my_setting.php', [App\Controller\Setting\SettingController::class, 'mySetting']);// 我的设置页面信息
    Router::post('/setting/get_price.php', [App\Controller\Setting\SettingController::class, 'getPrice']);// 通话设置（获取价格）
    Router::post('/setting/set_price.php', [App\Controller\Setting\SettingController::class, 'setPrice']);// 通话设置（设置价格）
    Router::post('/setting/change_lang.php', [App\Controller\Setting\SettingController::class, 'changeLanguage']);// 切换语言
    Router::post('/setting/accept_video.php', [App\Controller\Setting\SettingController::class, 'acceptVideo']);// 接受匹配开关
    Router::post('/misc/hide_nick.php', [App\Controller\Setting\SettingController::class, 'setHideNickname']);// 接受匹配开关


    Router::post('/report/suggest.php', [App\Controller\Report\SuggestController::class, 'create']);// 反馈与建议
    Router::post('/report/tipoff.php', [App\Controller\Report\TipOffController::class, 'create']);// 举报
    Router::post('/report/journal.php', [App\Controller\Report\TipOffController::class, 'journal']);// 举报记录


    Router::post('/mission/list.php', [App\Controller\Mission\ListController::class, 'list']);// 任务列表
    Router::post('/mission/receive_award.php', [App\Controller\Mission\ListController::class, 'receiveAward']);// 领取任务


    Router::post('/misc/gift_list.php', [App\Controller\Gift\GiftController::class, 'list']);// 礼物列表

    Router::post('/pay/pay_switch.php', [App\Controller\Pay\PayController::class, 'payProductList']);// 获取支付商品列表
    Router::post('/pay/pay_url.php', [App\Controller\Pay\PayController::class, 'createPayOrder']);// 创建支付订单
    Router::post('/pay/apple_pay/query_order.php', [App\Controller\Pay\CheckRechargeOrderController::class, 'appleOrder']);// 苹果支付校验票据，处理充值逻辑(apple_pay/query_order.php)
    Router::post('/pay/google_pay/query_order.php', [App\Controller\Pay\CheckRechargeOrderController::class, 'googleOrder']);// 谷歌支付校验票据，处理充值逻辑(googlepay/callback_googlepay.php)
    Router::post('/pay/indo_pay/query_order.php', [App\Controller\Pay\CheckRechargeOrderController::class, 'indoOrder']);// 印尼支付校验票据，处理充值逻辑


    Router::post('/chat/room_list.php', [App\Controller\Chat\RoomController::class, 'index']);// 聊天室列表
    Router::post('/chat/room_create.php', [App\Controller\Chat\RoomController::class, 'create']);// 创建聊天室
    Router::post('/chat/room_update.php', [App\Controller\Chat\RoomController::class, 'update']);// 更新聊天室
    Router::post('/chat/room_show.php', [App\Controller\Chat\RoomController::class, 'show']);// 获取聊天室信息
    Router::post('/chat/room_stat.php', [App\Controller\Chat\RoomController::class, 'toggleCloseStat']);// 开放/关闭聊天室
    Router::post('/chat/set_room_role.php', [App\Controller\Chat\RoomController::class, 'setMemberRole']);// 将聊天室内指定用户设置为管理员、普通等级用户、黑名单用户或禁言用户
    Router::post('/chat/kick_room_member.php', [App\Controller\Chat\RoomController::class, 'kickMember']);// 踢人出聊天室
    Router::post('/chat/mute_room_member.php', [App\Controller\Chat\RoomController::class, 'mute']);// 禁言聊天室,或者禁言聊天室中的指定用户

    Router::post('/chat/user.php', [App\Controller\Chat\UserController::class, 'user']);// 进入聊天室的用户信息
    Router::post('/chat/user_list.php', [App\Controller\Chat\UserController::class, 'getUserList']);// 获取聊天室内用户列表
    Router::post('/chat/user_join_room.php', [App\Controller\Chat\UserController::class, 'userJoinRoom']);// 用户加入聊天室
    Router::post('/chat/user_exit_room.php', [App\Controller\Chat\UserController::class, 'userExitRoom']);// 用户退出聊天室
    Router::post('/chat/join_exit_micro.php', [App\Controller\Chat\UserController::class, 'joinExitMicro']); // 用户加入\退出麦克风

    Router::post('/chat/mi_lock.php', [App\Controller\Chat\MicroPhoneController::class, 'lock']); // 锁定\解锁麦克风位置
    Router::post('/chat/mi_voice.php', [App\Controller\Chat\MicroPhoneController::class, 'voice']); // 禁用\开启麦克风语音声音


},
    ['middleware' => [App\Middleware\RsaMiddleware::class => 10, App\Middleware\AuthMiddleware::class => 9]]
);
